package com.dycong.common.reflect;

import java.util.Arrays;

/**
 * Created by yu on 4/9/15.
 */
public class AssertUtil {

    public static void notNull(Object... args) {
        if (Arrays.stream(args).anyMatch(obj -> obj == null)) {
            throwException("got a null argument");
        }
    }

    public static void throwException() {
        throwException(null);
    }

    public static void throwException(String message) {
        throw new IllegalArgumentException(message);
    }
}
